home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / DBio.more / old / UStandard.h < prev   
Text File  |  1996-07-05  |  3KB  |  112 lines

  1. // UStandard --     selection of standard pas library 
  2. //    MPW/MacApp.3c++ version 
  3. //    © 1989-92 d.g. gilbert
  4.  
  5. #ifndef __USTANDARD__
  6. #define __USTANDARD__
  7.  
  8.  
  9. #ifndef __TYPES__
  10. #include <Types.h>
  11. #endif
  12.  
  13. #ifndef __GEOMETRY__
  14. #include <Geometry.h>
  15. #endif
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <QuickDraw.h>
  19. #endif
  20.  
  21. #ifndef __MEMORY__
  22. #include <Memory.h>
  23. #endif
  24.  
  25.    
  26. struct    hcFile    {
  27.         Handle    h; 
  28.         long        len;
  29.         Boolean    writing;
  30. };
  31.      
  32. //#define min(a,b)      (a<b)?a:b
  33. //#define max(a,b)      (a>b)?a:b
  34. #define is_upper(c)    ('A'<=(c) && (c)<='Z')
  35. #define is_lower(c)    ('a'<=(c) && (c)<='z')
  36. #define to_lower(c)    ((char)(is_upper(c) ? (c)+' ' : (c)))
  37. #define to_upper(c)    ((char)(is_lower(c) ? (c)-' ' : (c)))
  38.  
  39.  
  40. inline long max(long a, long b)
  41. {
  42.     return a > b ? a : b;
  43. }
  44.  
  45. inline long min(long a, long b)
  46. {
  47.     return a < b ? a : b;
  48. }
  49.  
  50. #ifdef __cplusplus
  51. extern "C"
  52. {
  53. #endif
  54.  
  55. pascal short cHeight();
  56. pascal short    cWidth();
  57.  
  58. pascal Boolean stopKey();  
  59. pascal Boolean capsLockIsDown();
  60. pascal Boolean shiftKeyIsDown();
  61. pascal Boolean cmdKeyIsDown();
  62. pascal Boolean optionKeyIsDown();
  63. //pascal Boolean controlKeyIsDown();
  64.  
  65. pascal Handle dupHandle(Handle h);
  66. pascal RgnHandle getClipRgn();
  67. pascal void setClipRgn( RgnHandle& r);
  68. pascal void getTeStyle( TextStyle& tStyle);
  69. pascal void CenterSFPut( Point& where);
  70. pascal void DrawIconls( WindowPtr aWindow, CRect& aRect, short icnID, short icnSize);
  71.  
  72. //pascal int Strcasecmp(const char *a, const char *b);     
  73. //pascal int Strncasecmp(const char *a, const char *b, long maxn); 
  74.  
  75. //pascal Str63 osType2Str( OSType os);
  76. //pascal OSType Str2osType(Str63 s);
  77. pascal void StripChar( char dropC, Handle h);
  78. pascal void TranslateChar( char fromC, char toC, Handle h);
  79. pascal Handle Str2Handle( CStr255 s);
  80. pascal CStr255 Handle2Str(Handle h);
  81. pascal void CleanMenuName(CStr255& aName);
  82.  
  83. pascal void hcOpen( hcFile& f, Handle h);
  84. pascal void hcRewrite( hcFile& f);
  85. pascal void hcClose( hcFile& f);
  86. pascal void hcRewind( hcFile& f);
  87. pascal Boolean hcEof( hcFile& f);
  88. pascal Boolean hcEoln( hcFile& f);
  89. pascal char hcRead( hcFile& f);
  90. pascal long hcReadLong( hcFile& f);
  91. pascal CStr255 hcReadTo( hcFile& f, char tochar);
  92. pascal Handle hcReadToHand( hcFile& f, char tochar);
  93. pascal CStr255 hcReadLn( hcFile& f);
  94. pascal void hcWrite( hcFile& f,  CStr255 s);
  95. pascal void hcWriteHand( hcFile& f, Handle h);
  96. pascal void hcWriteChar( hcFile& f, char ch);
  97. pascal void hcWriteInt( hcFile& f, long n);
  98. pascal void hcWriteln( hcFile& f, CStr255 s);
  99.  
  100. pascal Boolean TrapAvailable( unsigned short theTrap);
  101. pascal Boolean GestaltFlag( OSType attribute, short optionFlag);
  102.  
  103. pascal extern Boolean gHasGestalt;
  104.  
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108.  
  109. #endif
  110.  
  111.  
  112.